CauseUnion

PackageAxial
Represents the cause of a failed workflow.

Specification

Kind
Union
Members
21
Examples
0
mapSignature
Cause.map mapper cause
thenCauseSignature
Cause.thenCause left right
bothSignature
Cause.both left right
tracedSignature
Cause.traced trace cause
untracedSignature
Cause.untraced cause

Summary

NameSignatureSynopsis
Union cases
IsThenthis.IsThenNo description available.
IsTracedthis.IsTracedNo description available.
IsFailthis.IsFailNo description available.
IsInterruptthis.IsInterruptNo description available.
IsBoththis.IsBothNo description available.
IsDiethis.IsDieNo description available.
FailFail 'errorAn expected domain-specific failure.
DieDie exnAn unexpected defect or panic (e.g., an exception).
InterruptInterruptAn administrative signal to stop the workflow (e.g., cancellation).
ThenThen(Cause<'error>, Cause<'error>)Two causes happened sequentially; the left cause happened before the right cause.
BothBoth(Cause<'error>, Cause<'error>)Two causes happened concurrently; neither cause is ordered before the other.
TracedTraced(Cause<'error>, trace)A cause annotated with diagnostic trace text.
Operations
mapCause.map mapper causeTransforms the error value of a failure cause using the provided function.
thenCauseCause.thenCause left rightCombines causes that happened sequentially.
bothCause.both left rightCombines causes that happened concurrently.
tracedCause.traced trace causeAttaches diagnostic trace text to a cause.
untracedCause.untraced causeRemoves trace text from the top of a cause, returning the cause it annotates.
failuresCause.failures causeReturns every typed failure value contained in a cause tree.
defectsCause.defects causeReturns every defect exception contained in a cause tree.
isInterruptedCause.isInterrupted causeReturns whether the cause tree contains an interruption signal.
prettyPrintCause.prettyPrint formatError causePretty prints a cause tree for diagnostics.

Union cases

kind:member

IsThen

this.IsThen
Member

Returns

bool
kind:member

IsTraced

this.IsTraced
Member

Returns

bool
kind:member

IsFail

this.IsFail
Member

Returns

bool
kind:member

IsInterrupt

this.IsInterrupt
Member

Returns

bool
kind:member

IsBoth

this.IsBoth
Member

Returns

bool
kind:member

IsDie

this.IsDie
Member

Returns

bool
kind:member

Fail

Fail 'error
Member
An expected domain-specific failure.

Parameters

NameTypeDescription
Item'error

Returns

unit
kind:member

Die

Die exn
Member
An unexpected defect or panic (e.g., an exception).

Parameters

NameTypeDescription
Itemexn

Returns

unit
kind:member

Interrupt

Interrupt
Member
An administrative signal to stop the workflow (e.g., cancellation).

Returns

unit
kind:member

Then

Then(Cause<'error>, Cause<'error>)
Member
Two causes happened sequentially; the left cause happened before the right cause.

Parameters

NameTypeDescription
Item1Cause<'error>
Item2Cause<'error>

Returns

unit
kind:member

Both

Both(Cause<'error>, Cause<'error>)
Member
Two causes happened concurrently; neither cause is ordered before the other.

Parameters

NameTypeDescription
Item1Cause<'error>
Item2Cause<'error>

Returns

unit
kind:member

Traced

Traced(Cause<'error>, trace)
Member
A cause annotated with diagnostic trace text.

Parameters

NameTypeDescription
Item1Cause<'error>
tracestring

Returns

unit

Operations

kind:member

map

Cause.map mapper cause
Member
Transforms the error value of a failure cause using the provided function.

Parameters

NameTypeDescription
mapper'e -> 'fThe function to transform the error value.
causeCause<'e>The original cause to transform.

Returns

Cause<'f>
kind:member

thenCause

Cause.thenCause left right
Member
Combines causes that happened sequentially.

Parameters

NameTypeDescription
leftCause<'error>
rightCause<'error>

Returns

Cause<'error>
kind:member

both

Cause.both left right
Member
Combines causes that happened concurrently.

Parameters

NameTypeDescription
leftCause<'error>
rightCause<'error>

Returns

Cause<'error>
kind:member

traced

Cause.traced trace cause
Member
Attaches diagnostic trace text to a cause.

Parameters

NameTypeDescription
tracestring
causeCause<'error>

Returns

Cause<'error>
kind:member

untraced

Cause.untraced cause
Member
Removes trace text from the top of a cause, returning the cause it annotates.

Parameters

NameTypeDescription
causeCause<'error>

Returns

Cause<'error>

Verification Examples

match Cause.untraced cause with
| Cause.Fail error -> Some error
| _ -> None
kind:member

failures

Cause.failures cause
Member
Returns every typed failure value contained in a cause tree.

Parameters

NameTypeDescription
causeCause<'error>

Returns

'error list
kind:member

defects

Cause.defects cause
Member
Returns every defect exception contained in a cause tree.

Parameters

NameTypeDescription
causeCause<'error>

Returns

exn list
kind:member

isInterrupted

Cause.isInterrupted cause
Member
Returns whether the cause tree contains an interruption signal.

Parameters

NameTypeDescription
causeCause<'error>

Returns

bool
kind:member

prettyPrint

Cause.prettyPrint formatError cause
Member
Pretty prints a cause tree for diagnostics.

Parameters

NameTypeDescription
formatError'error -> string
causeCause<'error>

Returns

string